package overview;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class MenuSel {
    public static void main(String[] args) {
        int choise = 0;
        Scanner sc = new Scanner(System.in);
        while (true) {
            System.out.println("请选择（1-3）：");
            try {
                choise = sc.nextInt();
                switch (choise) {
                    case 1:
                        System.out.println("登陆");
                        return;
                    case 2:
                        System.out.println("注册");
                        return;
                    case 3:
                        System.out.println("联系客服");
                        return;
                    default:
                        throw new RuntimeException("输入错误");
                }
            } catch (RuntimeException e) {
                e.printStackTrace();
                sc.next();//缓冲区的读出来，丢掉=>清除输入缓冲区
            }
        }
    }
}
